package cn.zl.ymcc.service;

import cn.zl.ymcc.entity.MediaFile;
import cn.zl.ymcc.result.Result;
import com.baomidou.mybatisplus.extension.service.IService;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.multipart.MultipartFile;


/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zl
 * @since 2025-10-24
 */

@Tag(name = "MediaFile服务接口")

public interface MediaFileService extends IService<MediaFile> {


    Result register(String fileMd5, String fileName, Long fileSize, String mimetype, String fileExt);

    /**
     * 校验文件块是否已经存在了
     */
    Result checkchunk(String fileMd5, Integer chunk, Integer chunkSize);

    /**
     * 上传文件块
     */
    Result uploadchunk(MultipartFile file, String fileMd5, Integer chunk);

    /**
     * 合并文件快
     */
    Result mergechunks(String fileMd5, String fileName, Long fileSize, String mimetype, String fileExt,
                           Long courseChapterId, Long courseId, Integer number, String name, String courseName, String chapterName);

    //处理文件
    Result handleFile2m3u8(MediaFile mediaFile);
}


